
<div id="addresource"> Add resource</div>

<script>
$( "#addresource" ).click(function() {
  $( "#newresource_form" ).toggle( "slow", function() {
  });
});
</script>
<div id="newresource_form" style="display: none;">
    <h3>Add Resource</h3>
     <% if flash[:notice] %>
        <div class="notice"><%= flash[:notice] %></div>
      <% end %>

    <p>
    <%= form_for @resource, :url => { :action => "createresource" } do |f| %>
      <% if @resource.errors.any? %>
        <div id="error_explanation">
          <h2><%= pluralize(@resource.errors.count, "error") %> prohibited this event from being saved:</h2>

          <ul>
          <% @resource.errors.full_messages.each do |msg| %>
            <li><%= msg %></li>
          <% end %>
          </ul>
        </div>
      <% end %>

      <div class="field">
        <%= f.label "Resource Name:" %><br />
        <%= f.text_field :name %>
      </div> 
      
      <div class="field">
        <%= f.label :description %><br />
        <%= f.text_area :description %>
      </div>
      

      
      
      <div class="field">
        <%= f.label "Color:" %><br />
        <%= f.text_field :color %>
      </div>  
      
        <div class="field">
        <%= f.label "Text color:" %><br />
        <%= f.text_field :textcolor %>
      </div>  
      
      <div class="actions">
        <%= f.submit %>
      </div>
    <% end %>
</div>